//
//  ShoppingCartCell.m
//  TaoBaoShoppingCart
//
//  Created by MKJING on 16/9/10.
//  Copyright © 2016年 MKJING. All rights reserved.
//

#import "ShoppingCartCell.h"

@implementation ShoppingCartCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.productImageView.clipsToBounds = YES;
    self.buyerImageView.clipsToBounds = YES;
    
    self.minusButton.layer.borderWidth = 1;
    self.plusButton.layer.borderWidth = 1;
    self.editCountLabel.layer.borderWidth = 1;
    self.plusButton.layer.borderColor = kGrayColor.CGColor;
    self.editCountLabel.layer.borderColor = kGrayColor.CGColor;
    self.minusButton.layer.borderColor = kGrayColor.CGColor;
    
    
    
}

// 点击单个商品选择的按钮回调
- (IBAction)clickSelected:(UIButton *)sender {
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(productSelected:isSelected:)])
    {
        [self.delegate productSelected:self isSelected:!sender.selected];
    }
}

// 点击买手头部选择按钮回调
- (IBAction)clickBuyerSelcted:(id)sender {
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(buyerSelected:)]) {
     
        [self.delegate buyerSelected:self.sectionIndex];
    }
}

// 点击买手头部编辑按钮回调

// 点击单个cell里面的垃圾桶回调

// 增加商品或者减少商品
- (IBAction)plusOrMinus:(UIButton *)sender {
    if (self.delegate &&[self.delegate respondsToSelector:@selector(plusOrMinusCount:tag:)]) {
        [self.delegate plusOrMinusCount:self tag:sender.tag];
    }
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
